namespace t
{
    const NUM = 1000000;

    const array: number[] = [];
    array.length = NUM;

    const float32Array0 = new Float32Array(array);

    console.group('Float32Array-constructor');

    console.time('constructor-array');
    const float32Array = new Float32Array(array);
    console.timeEnd('constructor-array');

    console.time('constructor-number');
    const float32Array1 = new Float32Array(NUM);
    console.timeEnd('constructor-number')

    console.time('constructor-for');
    const float32Array2 = new Float32Array(NUM);
    for (let i = 0; i < NUM; i++)
    {
        float32Array2[i] = i;
    }
    console.timeEnd('constructor-for');

    console.time('constructor-for1');
    const float32Array3 = new Float32Array(NUM);
    for (let i = 0; i < NUM; i++)
    {
        float32Array3[i] = array[i];
    }
    console.timeEnd('constructor-for1')

    console.groupEnd();
}